//
//  LCZPhotosetTableViewCell.m
//  PersonalNews
//
//  Created by dllo on 15/11/30.
//  Copyright © 2015年 changshuhua. All rights reserved.
//

#import "LCZPhotosetTableViewCell.h"

@implementation LCZPhotosetTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.titleLabel = [[LCZBaseLabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
//    self.titleLabel.backgroundColor = [UIColor redColor];
    
    self.leftImg = [[LCZBaseImageView alloc] init];
    [self.contentView addSubview:self.leftImg];
//    self.leftImg.backgroundColor = [UIColor yellowColor];
    
    self.midImg = [[LCZBaseImageView alloc] init];
    [self.contentView addSubview:self.midImg];
//    self.midImg.backgroundColor = [UIColor blueColor];
    
    self.rightImg = [[LCZBaseImageView alloc] init];
    [self.contentView addSubview:self.rightImg];
//    self.rightImg.backgroundColor = [UIColor magentaColor];
    
    self.replyCountLabel = [[LCZBaseLabel alloc] init];
    [self.contentView addSubview:self.replyCountLabel];
//    self.replyCountLabel.backgroundColor = [UIColor purpleColor];
    self.replyCountLabel.textAlignment = NSTextAlignmentRight;
    self.replyCountLabel.font = [UIFont systemFontOfSize:14];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.equalTo(self.contentView).with.offset(5);
        make.top.equalTo(self.contentView).with.offset(10);
        make.height.mas_equalTo(23);
        make.right.equalTo(self.contentView).with.offset(-100);
        
    }];
    
    [self.replyCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.equalTo(self.titleLabel.mas_right).with.offset(0);
        make.height.equalTo(self.titleLabel);
        make.top.equalTo(self.contentView).with.offset(10);
        make.right.equalTo(self.contentView).with.offset(-5);
        
    }];
    
    [self.leftImg mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.equalTo(self.contentView).with.offset(5);
        make.top.equalTo(self.titleLabel.mas_bottom).with.offset(3);
        make.bottom.equalTo(self.contentView).with.offset(-10);
        make.width.mas_equalTo((SCREENWIDTH - 20) / 3);
        
    }];
    
    [self.midImg mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.leftImg.mas_right).with.offset(5);
        make.top.equalTo(self.titleLabel.mas_bottom).with.offset(3);
        make.bottom.equalTo(self.contentView).with.offset(-10);
        make.width.equalTo(self.leftImg);
        
    }];
    
    [self.rightImg mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.midImg.mas_right).with.offset(5);
        make.top.equalTo(self.titleLabel.mas_bottom).with.offset(3);
        make.bottom.equalTo(self.contentView).with.offset(-10);
        make.width.equalTo(self.leftImg);
        
    }];
    
}

@end
